<template>
    <div class="sidebar">
        <el-menu class="sidebar-el-menu" default-active="1" background-color="#1d305f"
            text-color="#bfcbd9" active-text-color="#fff" router>
            <template v-for="item in items">
                <template>
                    <el-menu-item :index="item.index" :key="item.index" class="elItem">
                        <img :src="require(`@/assets/img/siderButton${item.index}.png`)" :alt="item.index">
                        <span slot="title">{{ item.title }}</span>
                    </el-menu-item>
                </template>
            </template>
        </el-menu>
    </div>
</template>

<script>
    import bus from '../common/bus';
    export default {
        data() {
            return {
                items: [
                    {
                        index: '1',
                        title: '首页'
                    },
                    {
                        index: '2',
                        title: '文件分析'
                    },
                    {
                        index: '3',
                        title: '标签抽取图'
                    },
                    {
                        index: '4',
                        title: '实体归类',
                    },
                    {
                        index: '5',
                        title: '实体关联'
                    },
                    {
                        index: '6',
                        title: '知识聚集'
                    },
                    {
                        index: '7',
                        title: '知识图谱可视化'
                    }

                ]
            }
        },
        computed:{
            onRoutes(){
                return this.$route.path.replace('/','');
            }
        },
        created(){
        }
    }
</script>

<style scoped>
    .elItem {
        text-align: center;
        overflow: hidden;
        height: 100px;
        line-height: 1px;
    }
    .elItem img {
        display: block;
        margin: 11px auto;
        width: 50px;
    }
    .elItem.is-active {
        background: url('~@/assets/img/siderButtonSel.png') no-repeat;
        background-size: 200px 100px;
    }
    .sidebar{
        display: block;
        position: absolute;
        left: 0;
        top: 91px;
        bottom:0;
        /* overflow-y: scroll; */
    }
    .sidebar::-webkit-scrollbar{
        width: 0;
    }
    .sidebar-el-menu {
        width: 200px;
    }
    .sidebar > ul {
        height:100%;
        /* padding-top: 32px; */
    }
</style>
